<!-- this is post id <%= post.id %> -->

<div class="post" id="post-<%= post.id %>">
	<div class="postMeta fix"><span class="date"><%= date_time(post) %></span></div>
	<h2><a href="<%= Post.permalink(post) %>" title="<%= post.title %>"><%= post.title %></a></h2>
	<div class="entry">
    <p>
			<%= post.body %>
    	<%= extended_content_block(post) -%>
		</p>
	</div>
</div>

<%# ##################################################### -%>
<%# This is the logic/code for comments... you can copy   -%>
<%# this and use it in your themes to support comments    -%>
<%# ##################################################### -%>
<% if Site.comment_system_on then -%>
	<!-- comments for this post -->
	<div id="comments_wrapper">
		<div id="comments" class="section"><h3><%= post.comments.length == 0 ? "No Comments" : pluralize(post.comments.length, 'Comment') %><% if accepting_comments(post) %>, <a href="#respond" title="Leave a comment">Comment</a><% end %></h3></div>
		<% if post.comments.length > 0 -%>
			<% oddcomment = 'alt' -%>
			<ol class="commentslist">
		    <% for comment in post.comments -%>
					<%= comment.email %> vs. <%= post.author.email %>
					<li class="<%= comment.email == post.author.email ? 'author' : oddcomment %> item" id="comment-<%= comment.id%>">
						<div class="fix">
							<div class="author_meta">
								<p class="author_meta"><span class="user"><%= comment_author(comment) %></span></p>
							</div>
							<div class="comment_text">
								<%= comment.body %>
							</div>
							<p class="post_meta"><a href="<%= Post.permalink(post)%>#comment-<%= comment.id %>" title="Permalink for this comment"><%= comment.created_at.strftime(Site.date_format) %> at <%= comment.created_at.strftime(Site.time_format) %></a></p>
						</div>
					</li>
					<% oddcomment = oddcomment == 'alt' ? '' : 'alt' -%>
				<% end -%>
			</ol>
		<% elsif not accepting_comments(post) -%>
			<div id="comments_closed">
				<p class="nocomments">Comments are closed.</p>
			</div>
		<% end -%>
		<% if accepting_comments(post) -%>
			<h3 id="respond">Reply to &#8220;<%= post.title %>&#8221;</h3>
			<% if flash[:notice] %><em><%= flash[:notice] %></em><% end %>
			<% form_tag(Site.full_url + '/comments/add', :id => 'commentform') do %>
				<%= hidden_field_tag 'do', '1' %>
				<%# ###################################################### -%>
				<%# This is used to check if commenter is human by seeing  -%>
				<%# if they actually input text into any of the boxes and  -%>
				<%# requires the additional :onclick and :onkeypress below -%>
				<%# ###################################################### -%>
				<%= hidden_field_tag 'human_check', '0' %>
				<%= hidden_field_tag 'return_url', Post.permalink(post) %>
				<%= hidden_field_tag 'link', post.permalink %>
				<%= hidden_field 'comment', 'post_id', :value => post.id.to_s %>
				<%  temp_repair = error_messages_for('comment') || '' %>
				<%= temp_repair.gsub('Body raw', 'Body') %>
				<p><%= text_field 'comment', 'name', :size => 22, :tabindex => 1 %>
				<label for="comment_name"><small>Name</small></label></p>
				<p><%= text_field 'comment', 'email', :size => 22, :tabindex => 2 %>
				<label for="comment_email"><small>Mail (required)</small></label></p>
				<p><%= text_field 'comment', 'url', :size => 22, :tabindex => (index = 3) %>
				<label for="comment_url"><small>Website</small></label></p>
				<% if Site.allow_comment_subjects -%>
					<p><%= text_field 'comment', 'subject', :size => 22, :tabindex => (index += 1) %>
						<label for="comment_subject"><small>Subject</small></label></p>
				<% end -%>
				<p><%= text_area 'comment', 'body_raw', :rows => 10, :cols => 60, :tabindex => (index += 1), :wrap => 'virtual', :onkeypress => "this.form.elements['human_check'].value = '8'" %></p>
				<p><%= image_submit_tag theme_image_path('btn_submit.gif'), :name => 'commit', :id => 'submit', :alt => 'Submit', :tabindex => (index += 1), :value => 'Submit comment', :onclick => "this.form.elements['human_check'].value = '8'" %></p>
			<% end -%>
		<% end -%>
	</div>
	<!-- end comments -->
<% end -%>
<%# ##################################################### -%>
<%# This is the end of the comment logic block            -%>
<%# ##################################################### -%>

<!-- end post id <%= post.id %> -->